import request from '@/utils/request'
export const getRoleList = (params) => {
  /* return request({
    url: '/sys/role',
    params
  }) */
  return request.get('/sys/role', { params })
  // request.post('/sys/role', params)
}

export const getCompanyInfo = (id) => {
  return request({
    url: `/company/${id}`
  })
}
// 删除角色
export function deleteRole(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'DELETE'
  })
}

// 更新角色
export const updateRole = (data) => {
  return request({
    url: `/sys/role/${data.id}`,
    method: 'PUT',
    data
  })
}
// !根据角色 id 获取详情
export const getRoleDetail = (id) => {
  return request({
    url: `/sys/role/${id}`
  })
}

// 新增角色
export function addRole(data) {
  return request({
    url: '/sys/role',
    data,
    method: 'POST'
  })
}

// 准备给角色分配权限的接口
export const assignPerm = (data) => {
  return request({
    url: '/sys/role/assignPrem',
    method: 'PUT',
    data
  })
}
